<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;
use think\model\concern\SoftDelete;

/**
 * @property bool $sex 性别:0=男士,1=女士
 * @property bool $status 状态:0=下架,1=上架
 * @property float $latitude 纬度
 * @property float $longitude 经度
 * @property float $price 价格
 * @property int $browse 浏览人数
 * @property int $class_id 类目
 * @property int $collect 收藏数量
 * @property int $comment 评论数量
 * @property int $deletetime
 * @property int $id
 * @property int $is_sale 是否售出:0=否,1=是
 * @property int $like 点赞人数
 * @property int $users_id 用户
 * @property int $want 想要人数
 * @property string $adcode
 * @property string $address 地址
 * @property string $content 描述
 * @property string $createtime
 * @property string $hk_area_ids
 * @property string $images 图片
 * @property string $mobile 电话号
 * @property string $qq_code QQ号
 * @property string $username 联系人
 * @property string $video_files 视频
 * @property string $whats_code WhatsAPP
 * @property string $wx_code 微信号
 * @property-read \app\model\SecGoodsClass $class
 * @property-read \app\model\Users $users
 * @property-read \app\model\UsersCollect $users_collect
 * @property-read \app\model\UsersLike $users_like
 * @method static \think\db\Query onlyTrashed()
 * @method static \think\db\Query withTrashed()
 * @mixin \think\Model
 */
class SecGoods extends Model
{
    use SoftDelete;
    protected $deleteTime = 'deletetime';
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';

    public function users()
    {
        return $this->belongsTo(Users::class, 'users_id');
    }
	
	function class()
	{
		return $this->belongsTo(SecGoodsClass::class,'class_id');
	}

    public function usersCollect()
    {
        return $this->hasOne(UsersCollect::class,'pro_id');

    }

    public function usersLike()
    {
        return $this->hasOne(UsersLike::class,'pro_id');
    }

}
